﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing {
    import flash.display.*;
    import flash.filters.*;
    import org.aswing.graphics.*;

    public class SimpleButtonIcon implements Icon {

        private static var disabledFilters:Array;
        private static var eabledFilters:Array = [];

        private var asset:SimpleButton;
        private var width:int;
        private var height:int;

        public function SimpleButtonIcon(_arg1:SimpleButton){
            var _local2:Array;
            super();
            this.asset = _arg1;
            this.width = Math.ceil(_arg1.width);
            this.height = Math.ceil(_arg1.height);
            if (disabledFilters == null){
                _local2 = [0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0, 0, 0, 1, 0];
                disabledFilters = [new ColorMatrixFilter(_local2)];
            };
        }
        public function getDisplay(_arg1:Component):DisplayObject{
            return (this.asset);
        }
        public function getIconWidth(_arg1:Component):int{
            return (this.width);
        }
        public function getIconHeight(_arg1:Component):int{
            return (this.height);
        }
        public function updateIcon(_arg1:Component, _arg2:Graphics2D, _arg3:int, _arg4:int):void{
            this.asset.x = _arg3;
            this.asset.y = _arg4;
            this.asset.mouseEnabled = _arg1.isEnabled();
            this.asset.filters = (_arg1.isEnabled()) ? eabledFilters : disabledFilters;
        }

    }
}//package org.aswing 
